﻿using System;
using System.Text;

namespace Rio.Framework.Pages.Helpers.Utils
{
    public class Base64Utils
    {
        public static string Encode(string rawString)
        {
            byte[] buffer = Encoding.UTF8.GetBytes(rawString);
            return Convert.ToBase64String(buffer);
        }

        public static string Decode(string rawString)
        {
            byte[] buffer = Convert.FromBase64String(rawString);
            int bufferLength = buffer.Length;

            return Encoding.UTF8.GetString(buffer, 0, bufferLength);
        }
    }
}
